package com.suncnpap.system.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.suncnpap.system.mapper.TMakeMakeMapper;
import com.suncnpap.system.model.CancelMakeVo;
import com.suncnpap.system.model.MakeVo;
import com.suncnpap.system.model.TMakeMake;
import com.suncnpap.system.service.TMakeMakeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("tMakeMakeService")
public class TMakeMakeServiceImpl implements TMakeMakeService {

    @Autowired
    private TMakeMakeMapper tMakeMakeMapper;

    @Override
    public Integer getMake(TMakeMake tMakeMake) {
        Integer Make=tMakeMakeMapper.Make(tMakeMake);
        return Make;
    }

    @Override
    public TMakeMake isMake(String id) {
        TMakeMake tMakeMake=tMakeMakeMapper.isMake(id);
        return tMakeMake;
    }

    @Override
    public PageInfo<TMakeMake> makeList(MakeVo makeVo) {
        int pageIndex = makeVo.getPageIndex();
        int pageSize = makeVo.getPageSize();
        PageHelper.startPage(pageIndex,pageSize);
        List<TMakeMake> tMakeMake = tMakeMakeMapper.makeList(makeVo);
        PageInfo<TMakeMake> tMakeMakeList = new PageInfo<>(tMakeMake);
        return tMakeMakeList;
    }

    @Override
    public Integer cancelMake(CancelMakeVo cancelMakeVo) {
        Integer cancel=tMakeMakeMapper.cancelMake(cancelMakeVo);
        return cancel;
    }

    @Override
    public TMakeMake make(TMakeMake tMakeMake) {
        TMakeMake tMake=tMakeMakeMapper.make(tMakeMake);
        return tMake;
    }

    @Override
    public List<TMakeMake> getMakeList() {
        List<TMakeMake> tMakeMakes=tMakeMakeMapper.getMakeList();
        return tMakeMakes;
    }

    @Override
    public Integer automaticMake(String id) {
        Integer tMakeMake=tMakeMakeMapper.automaticMake(id);
        return tMakeMake;
    }

    @Override
    public TMakeMake makes(String strBookBarcode, String strSchool, String strReaderCardNumber) {
        TMakeMake tMakeMake=tMakeMakeMapper.makes(strBookBarcode,strSchool,strReaderCardNumber);
        return tMakeMake;
    }
}